package org.example.mylogin.common;

import lombok.Data;

@Data
public class Result {

    private Integer code;
    private String message;
    private Boolean flag;//boolean 与 Boolean
    private Object data;

    public static Result success(Object data) {
        Result result = new Result();
        result.code = 20000;
        result.message = "操作成功";
        result.flag = true;
        result.data = data;
        return result;
    }

    public static Result failure(String msg){
        Result result = new Result();
        result.code = -1;
        result.message = "操作失败";
        result.flag = false;
        result.data = msg;
        return result;
    }


}
